home *** CD-ROM | disk | FTP | other *** search
- Path: news1.cris.com!Crawford
- From: Crawford@cris.com (CRAWFORD)
- Newsgroups: comp.lang.c
- Subject: Re: Zombies & Daemons
- Date: 28 Feb 1996 20:36:02 GMT
- Organization: Concentric Internet Services
- Message-ID: <4h2ebi$kf5@spectator.cris.com>
- References: <3134348F.7526@citenet.net>
- Reply-To: crawford@iac.net
- NNTP-Posting-Host: mariner.cris.com
-
- Oliver Lavery <oliver@citenet.net> writes:
- >I've just finished writting a daemon to handle generating web
- >pages from an Oracle database. When it executes, the parent forks a
- >number of children, all of which are bound to a network port. Each child
- >services requests in order etc. etc. works more or less like an apache
- >httpd...
-
- Sounds cool!
-
- > The problem is this: when one of the children dies for whatever
- >reason (usually a f*cked OCI call which makes the daemons session
- >unstable), the parent's sigcld handler forks a new child to keep a
- >consistent number of processes running. For some reason, however, the
- >dead child process lingers around as a zombie process ... how do I avoid
- >this?
-
- Be sure to call wait(2) to harvest the child. It lets you
- retrieve the child's exit status, etc.
-
- > Also, does SunOS support copy on write memory pages? And do
- >zombie processes still use system resources?
-
- I believe SunOS does copy on write. Zombie processes use very
- little in the way of resources, at most some entries in the kernel
- tables for the process information.
-
- --
- "They sentenced me to twenty years of boredom, for trying to change
- the system from within."
- Robert Crawford crawford@iac.net
- http://www.iac.net/~crawford
-